<?php
require('functions/page_load.php');

$tradesmen_nav = true;
$active_tab = 'details';

$results = ($_GET['new'] == 'true') ? '<div class="success_result">Tradesman added successfully!</div>' : '' ;

if(isset($_GET['delete_question'])){

	$sql = "DELETE FROM questions WHERE id = '".mysql_real_escape_string($_GET['delete_question'])."'";
	$query = mysql_query( $sql ) or die ("Error in query: $sql. " . mysql_error());
	$results = '<div class="success_result">Question deleted successfully!</div>';
	$active_tab = 'questions';

}

if(isset($_GET['delete_quote'])){

	$sql = "DELETE FROM quotes WHERE id = '".mysql_real_escape_string($_GET['delete_quote'])."'";
	$query = mysql_query( $sql ) or die ("Error in query: $sql. " . mysql_error());
	$results = '<div class="success_result">Quote deleted successfully!</div>';
	$active_tab = 'quotes';

}

if(isset($_GET['delete_feedback'])){

	$sql = "DELETE FROM reviews WHERE id = '".mysql_real_escape_string($_GET['delete_feedback'])."'";
	$query = mysql_query( $sql ) or die ("Error in query: $sql. " . mysql_error());
	$results = '<div class="success_result">Feedback deleted successfully!</div>';
	$active_tab = 'feedback';

}

if(isset($_GET['delete_trade'])){

	$sql = "DELETE FROM tradesman_to_trade WHERE id = '".mysql_real_escape_string($_GET['delete_trade'])."'";
	$query = mysql_query( $sql ) or die ("Error in query: $sql. " . mysql_error());
	$results = '<div class="success_result">Trade deleted successfully!</div>';
	$active_tab = 'trades';

}

if($_SERVER['REQUEST_METHOD'] == 'POST'){

	if($_POST['action'] == 'add_trade'){
	
	$sql = "INSERT INTO tradesman_to_trade SET trade_id = '".mysql_real_escape_string($_POST['trade_id'])."', tradesman_id = '".mysql_real_escape_string($_GET['id'])."'";
	$query = mysql_query( $sql ) or die ("Error in query: $sql. " . mysql_error());
	$results = '<div class="success_result">Trade added successfully!</div>';
	$active_tab = 'trades';
	
	}
	
	if($_POST['action'] == 'add_feedback'){
	
	$date_reviewed = date("Y-m-d", strtotime(str_replace('/', '-', $_POST['date_reviewed'])));
	
	$sql = "INSERT INTO reviews SET rating = '".$_POST['rating']."', review = '".$_POST['review']."', date_reviewed = '".$date_reviewed."', tradesman_id = '".mysql_real_escape_string($_GET['id'])."'";
	$query = mysql_query( $sql ) or die ("Error in query: $sql. " . mysql_error());
	$results = '<div class="success_result">Feedback added successfully!</div>';
	$active_tab = 'feedback';
	
	}	

	if($_POST['action'] == 'update_tradesman'){
	
	$subscription_expiration = date("Y-m-d", strtotime(str_replace('/', '-', $_POST['subscription_expiration'])));
	$established = date("Y-m-d", strtotime(str_replace('/', '-', $_POST['established'])));
	
	//Change By Vyas Ishan 17 May 2013 Task2
	$meta_description = htmlspecialchars($_POST['meta_description']);
	$meta_keyword = htmlspecialchars($_POST['meta_keyword']);
	
	//Change By Vyas Ishan 17 May 2013 Task2 
	#meta Keyword and meta Description were added in the update query
	$sql = "UPDATE tradesman SET 
			subscription_id = '".mysql_real_escape_string($_POST['subscription_id'])."', 
			company_name = '".mysql_real_escape_string($_POST['company_name'])."', 
			active = '".mysql_real_escape_string($_POST['active'])."', 
			description = '".mysql_real_escape_string($_POST['description'])."', 
			website = '".mysql_real_escape_string($_POST['website'])."', 
			company_type = '".mysql_real_escape_string($_POST['company_type'])."', 
			established = '".mysql_real_escape_string($established)."', 
			subscription_expiration = '".mysql_real_escape_string($subscription_expiration)."', 
			meta_keyword = '".$meta_keyword."', 
			meta_description = '".$meta_description."' 
			WHERE id = '".mysql_real_escape_string($_GET['id'])."'";
	$query = mysql_query( $sql ) or die ("Error in query: $sql. " . mysql_error());
	
	// update address
	
	// lat and long
	
	$sql = "SELECT area FROM areas WHERE id = '".mysql_real_escape_string($_POST['area_id'])."'";
	$query=mysql_query( $sql ) or die ("Error in query: $sql . " . mysql_error());
	$rs=mysql_fetch_assoc($query);
	
	$address = $_POST['line_1'].",".$_POST['line_2'].",".$_POST['line_3'].",".$rs['area'].",".$_POST['postcode'];
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, "http://maps.google.com/maps/geo?q=".urlencode($address)."&output=csv&oe=utf8&sensor=false&key=".$settings['google_api_key']);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $output = curl_exec($ch);
        curl_close($ch);
	$outputArr = explode(",",$output);
	
	$sql = "UPDATE addresses SET 
			area_id = '".mysql_real_escape_string($_POST['area_id'])."', 
			line_1 = '".mysql_real_escape_string($_POST['line_1'])."', 
			line_2 = '".mysql_real_escape_string($_POST['line_2'])."', 
			line_3 = '".mysql_real_escape_string($_POST['line_3'])."', 
			postcode = '".mysql_real_escape_string($_POST['postcode'])."',
			latitude = '".$outputArr[2]."', 
			longitude = '".$outputArr[3]."' 
			WHERE id = '".mysql_real_escape_string($_POST['address_id'])."'";
	$query = mysql_query( $sql ) or die ("Error in query: $sql. " . mysql_error());

	$results = '<div class="success_result">Tradesman updated successfully!</div>';

	}

}

//Change By Vyas Ishan 17 May 2013 Task2 
#Added the meta_keyword and meta_description field in the query
$sql = "SELECT tradesman.id, tradesman.user_id, tradesman.address_id, subscription_id, company_name, active, description, website, company_type, established, subscription_expiration, area_id, line_1, line_2, line_3, postcode, tradesman.meta_keyword, tradesman.meta_description FROM tradesman 
		LEFT JOIN addresses ON tradesman.address_id = addresses.id 
		WHERE tradesman.id = '".mysql_real_escape_string($_GET['id'])."'";
$query = mysql_query( $sql ) or die ("Error in query: $sql. " . mysql_error());
$rs = mysql_fetch_assoc($query);

require('includes/header.php');
?>

<div class="side_container">
<h2 class="container_header">Filters</h2>

<ul>
<li><a href="tradesmen.php">Active tradesmen</a></li>
<li><a href="tradesmen.php?show=inactive">Tradesmen awaiting moderation</a></li>
</ul>

</div>

<div class="main_container_wrapper">

	<div class="main_container">
	<h2 class="container_header">Edit Tradesman</h2>
	
	<div id="top_links">
	<a href="edit_user.php?id=<?php echo $rs['user_id']; ?>" style="background-image: url(images/user.png); padding-left: 20px;">View user</a>
	<a class="tab_link" rel="#feedback" style="background-image: url(images/star.png); padding-left: 20px;">Feedback</a>
	<a class="tab_link" rel="#questions" style="background-image: url(images/help.png); padding-left: 20px;">Questions</a>
	<a class="tab_link" rel="#quotes" style="background-image: url(images/money.png); padding-left: 20px;">Quotes</a>
	<a class="tab_link" rel="#trades" style="background-image: url(images/tradesman.png); padding-left: 20px;">Trades</a>
	<a class="tab_link" rel="#details" style="background-image: url(images/page.png); padding-left: 20px;">Tradesman details</a>
	<a href="tradesmen.php" style="background-image: url(images/back.png); padding-left: 20px;">Back to Tradesmen</a>
	</div>
	
	<?php echo $results; ?>
	
		<div id="details" class="tab_container"<?php echo ($active_tab == 'details') ? ' style="display: block;"' : ' style="display: none;"' ; ?>>
		
			<form method="post" action="">
			
			<input type="hidden" name="action" value="update_tradesman" />
			<input type="hidden" name="address_id" value="<?php echo $rs['address_id']; ?>" />

			<div class="form_row_wrapper">
			<div class="form_row_left"><label for="company_name">Company Name:</label></div>
			<div class="form_row_right"><input type="text" name="company_name" id="company_name" class="textbox" value="<?php echo $rs['company_name']; ?>" style="width: 520px;" /></div>
			</div>
			
			<div class="form_row_wrapper">
			<div class="form_row_left"><label for="description">Description:</label></div>
			<div class="form_row_right"><textarea name="description" id="description" rows="6" cols="30" class="textbox" style="width: 520px; height: 200px;"><?php echo $rs['description']; ?></textarea></div>
			</div>
			
			<div class="form_row_wrapper">
			<div class="form_row_left"><label for="company_type">Company type:</label></div>
			<div class="form_row_right"><select name="company_type" id="company_type">
			<option value="Sole trader"<?php echo ($rs['description'] == 'Sole trader') ? ' selected="selected"' : '' ; ?>>Sole trader</option>
			<option value="Limited company"<?php echo ($rs['description'] == 'Limited company') ? ' selected="selected"' : '' ; ?>>Limited company</option>
			<option value="PLC"<?php echo ($rs['description'] == 'PLC') ? ' selected="selected"' : '' ; ?>>PLC</option>
			<option value="Partnership"<?php echo ($rs['description'] == 'Partnership') ? ' selected="selected"' : '' ; ?>>Partnership</option>
			</select></div>
			</div>
			
			<div class="form_row_wrapper">
			<div class="form_row_left"><label for="established">Established:</label></div>
			<div class="form_row_right"><input type="text" name="established" id="established" value="<?php echo date("d/m/Y", strtotime($rs['established'])); ?>" /></div>
			</div>
			
			<script type="text/javascript">
			$(function() {
				$("#established").datepicker({ dateFormat: 'dd/mm/yy', setDate: '<?php echo date("d/m/Y", strtotime($rs['established'])); ?>' });
			});
			</script>
			
			<div class="form_row_wrapper">
			<div class="form_row_left"><label for="website">Website:</label></div>
			<div class="form_row_right"><input type="text" name="website" id="website" class="textbox" value="<?php echo $rs['website']; ?>" /></div>
			</div>
			
			<div class="form_row_wrapper">
			<div class="form_row_left"><label for="subscription_id">Subscription:</label></div>
			<div class="form_row_right"><select name="subscription_id" id="subscription_id">
			<?php
				//Change By Vyas Ishan 24 May 2013 Task2 added the status field condition
			$sql = "SELECT id, radius FROM subscriptions  where status = '1' ORDER BY radius";
			$subscription_query = mysql_query( $sql ) or die ("Error in query: $sql. " . mysql_error());
			while($subscription_rs = mysql_fetch_assoc($subscription_query)){
			
				$selected = ($subscription_rs['id'] == $rs['subscription_id']) ? ' selected="selected"' : '' ;
				echo '<option value="'.$subscription_rs['id'].'"'.$selected.'>'.$subscription_rs['radius'].' Miles</option>';
			
			}
			
			?>
			</select></div>
			</div>
			
			<div class="form_row_wrapper">
			<div class="form_row_left"><label for="subscription_expiration">Subscription expiration:</label></div>
			<div class="form_row_right"><input type="text" name="subscription_expiration" id="subscription_expiration" value="<?php echo date("d/m/Y", strtotime($rs['subscription_expiration'])); ?>" /></div>
			</div>
			
			<script type="text/javascript">
			$(function() {
				$("#subscription_expiration").datepicker({ dateFormat: 'dd/mm/yy', setDate: '<?php echo date("d/m/Y", strtotime($rs['subscription_expiration'])); ?>' });
			});
			</script>
			
			<div class="form_row_wrapper">
			<div class="form_row_left"><label for="line_1">Address:</label></div>
			<div class="form_row_right"><span>Editing this address, will edit the tradesmans address throughout the system.</span><br />
			<input type="text" name="line_1" id="line_1" class="textbox" value="<?php echo $rs['line_1']; ?>" />
			<input type="text" name="line_2" id="line_2" class="textbox" value="<?php echo $rs['line_2']; ?>" />
			<input type="text" name="line_3" id="line_3" class="textbox" value="<?php echo $rs['line_3']; ?>" />
			<select name="area_id" id="area_id" style="margin-top: 5px;" class="textbox clearLeft">
			<?php
			
			$sql = "SELECT id, area FROM areas ORDER BY area";
			$area_query = mysql_query( $sql ) or die ("Error in query: $sql. " . mysql_error());
			while($area_rs = mysql_fetch_assoc($area_query)){
			
			$selected = ($area_rs['id'] == $rs['area_id']) ? ' selected="selected"' : '' ;
			echo '<option value="'.$area_rs['id'].'"'.$selected.'>'.$area_rs['area'].'</option>';
			
			}
			
			?></select>
			<input type="text" name="postcode" id="postcode" class="textbox clearLeft" value="<?php echo $rs['postcode']; ?>" style="width: 80px;" />
			</div>
			</div>
			
			<?php //Change By Vyas Ishan 17 May 2013 Task2?>
			<div class="form_row_wrapper">
			<div class="form_row_left"><label for="description">Meta Keywords:</label></div>
			<div class="form_row_right"><textarea name="meta_keyword" id="meta_keyword" rows="3" cols="10" class="textbox" style="width: 520px;"><?php echo $rs['meta_keyword']; ?></textarea></div>
			</div>
			
			<div class="form_row_wrapper">
			<div class="form_row_left"><label for="description">Meta Description:</label></div>
			<div class="form_row_right"><textarea name="meta_description" id="meta_description" rows="3" cols="10" class="textbox" style="width: 520px;"><?php echo $rs['meta_description']; ?></textarea></div>
			</div>
			<?php //Change By Vyas Ishan 17 May 2013 Task2?>
			
			<div class="form_row_wrapper">
			<div class="form_row_left"><label for="active">Tradesman active:</label></div>
			<div class="form_row_right"><input type="checkbox" name="active" id="active" value="1"<?php echo ($rs['active'] == '1') ? ' checked="checked"' : '' ; ?> /></div>
			</div>
			
			<div class="form_row_wrapper">
			<div class="form_row_left">&nbsp;</div>
			<div class="form_row_right"><input type="image" src="images/save_button.png" alt="Save" /></div>
			</div>
			
			</form>
		
		</div>
		
		<div id="quotes" class="tab_container"<?php echo ($active_tab == 'quotes') ? ' style="display: block;"' : ' style="display: none;"' ; ?>>
		
		<table width="100%" cellpadding="0" cellspacing="0" class="cms_table">
		<thead><tr><th align="left">Job</th><th>Quote</th><th>Materials</th><th>Date</th><th align="left">Notes</th><th width="50">Delete</th></tr></thead>
		<tbody>
		<?php
		
		$sql = "SELECT quotes.id, quotes.job_id, quote, quotes.status, quotes.vat, quotes.materials, info, date_quoted, jobs.title FROM quotes 
				LEFT JOIN jobs ON quotes.job_id = jobs.id 
				WHERE tradesman_id = '".mysql_real_escape_string($_GET['id'])."'";
		$query=mysql_query( $sql ) or die ("Error in query: $sql . " . mysql_error());
		$rows = mysql_num_rows($query);
		
		if($rows > 0){
		
			while($rs=mysql_fetch_assoc($query)){
			
			$vat = ($rs['vat'] == '1') ? ' inc vat' : ' ex vat' ;

			echo '<tr><td align="left" valign="top"><a href="edit_job.php?id='.$rs['job_id'].'">'.$rs['title'].'</a></td><td valign="top">&pound;'.$rs['quote'].$vat.'</td><td valign="top"><img src="images/'.$rs['materials'].'.png" alt="" /></td><td valign="top">'.date("d/m/Y", strtotime($rs['date_quoted'])).'</td><td align="left">'.$rs['info'].'</td><td valign="top"><a onclick="confirm_delete(\'?id='.$_GET['id'].'&amp;delete_quote='.$rs['id'].'\',\'this quote\');" title="Delete"><img src="images/delete.png" alt="Delete" /></a></td></tr>';
			
			}
			
		}
		
		else{
		
		echo '<tr><td colspan="6">There are currently no quotes from this tradesman.</td></tr>';
		
		}
		
		?>
		
		</tbody></table>
		
		</div>
		
		<div id="questions" class="tab_container"<?php echo ($active_tab == 'questions') ? ' style="display: block;"' : ' style="display: none;"' ; ?>>
		
		
		<table width="100%" cellpadding="0" cellspacing="0" class="cms_table">
		<thead><tr><th align="left">Job</th><th align="left">Question</th><th align="left">Answer</th><th width="50">Delete</th></tr></thead>
		<tbody>
		<?php
		
		$sql = "SELECT questions.id, question, answer, job_id, jobs.title FROM questions 
				LEFT JOIN answers ON questions.id = answers.question_id 
				LEFT JOIN jobs ON questions.job_id = jobs.id 
				WHERE tradesman_id = '".mysql_real_escape_string($_GET['id'])."'";
		$query=mysql_query( $sql ) or die ("Error in query: $sql . " . mysql_error());
		$rows = mysql_num_rows($query);
		
		if($rows > 0){
		
			while($rs=mysql_fetch_assoc($query)){
			
			echo '<tr><td align="left" valign="top"><a href="edit_job.php?id='.$rs['job_id'].'">'.$rs['title'].'</a></td><td valign="top" align="left">'.$rs['question'].'</td><td valign="top" align="left">'.$rs['answer'].'</td><td valign="top"><a onclick="confirm_delete(\'?id='.$_GET['id'].'&amp;delete_question='.$rs['id'].'\',\'this question\');" title="Delete"><img src="images/delete.png" alt="Delete" /></a></td></tr>';
			
			}
			
		}
		
		else{
		
		echo '<tr><td colspan="4">There are currently no questions from this tradesman.</td></tr>';
		
		}
		
		?>
		
		</tbody></table>
		
		
		</div>
		
		
		<div id="trades" class="tab_container"<?php echo ($active_tab == 'trades') ? ' style="display: block;"' : ' style="display: none;"' ; ?>>
		
		<table width="100%" cellpadding="0" cellspacing="0" class="cms_table">
		<thead><tr><th align="left">Trade</th><th width="50">Delete</th></tr></thead>
		<tbody>
		<?php
		
		$sql = "SELECT tradesman_to_trade.id, trade FROM tradesman_to_trade 
				LEFT JOIN trades ON tradesman_to_trade.trade_id = trades.id 
				WHERE tradesman_id = '".mysql_real_escape_string($_GET['id'])."'
				ORDER BY trade";
		$query=mysql_query( $sql ) or die ("Error in query: $sql . " . mysql_error());
		$rows = mysql_num_rows($query);
		
		if($rows > 0){
		
			while($rs=mysql_fetch_assoc($query)){
			
			echo '<tr><td align="left" valign="top">'.$rs['trade'].'</td><td valign="top"><a onclick="confirm_delete(\'?id='.$_GET['id'].'&amp;delete_trade='.$rs['id'].'\',\'this trade\');" title="Delete"><img src="images/delete.png" alt="Delete" /></a></td></tr>';
			
			}
			
		}
		
		else{
		
		echo '<tr><td colspan="2">There are currently no trades for this tradesman.</td></tr>';
		
		}
		
		?>
		
		</tbody></table>
		
			<form method="post" action="">
			
			<input type="hidden" name="action" value="add_trade" />

			<div class="form_row_wrapper">
			<div class="form_row_left"><label for="trade_id">Add trade:</label></div>
			<div class="form_row_right"><select name="trade_id" id="trade_id">
			<?php
			
			$sql = "SELECT id, trade FROM trades ORDER BY trade";
			$trades_query = mysql_query( $sql ) or die ("Error in query: $sql. " . mysql_error());
			while($trades_rs = mysql_fetch_assoc($trades_query)){
			
				echo '<option value="'.$trades_rs['id'].'">'.$trades_rs['trade'].'</option>';
			
			}
			
			?>
			</select></div>
			</div>
			
			<div class="form_row_wrapper">
			<div class="form_row_left">&nbsp;</div>
			<div class="form_row_right"><input type="image" src="images/save_button.png" alt="Save" /></div>
			</div>
			
			</form>
		
		</div>
		
		
		<div id="feedback" class="tab_container"<?php echo ($active_tab == 'feedback') ? ' style="display: block;"' : ' style="display: none;"' ; ?>>
		
			<p style="padding-top: 10px;"><strong>Add review</strong></p>
		
			<form method="post" action="">
			
			<input type="hidden" name="action" value="add_feedback" />
			
			<div class="form_row_wrapper">
			<div class="form_row_left"><label for="review">Review:</label></div>
			<div class="form_row_right"><textarea name="review" id="review" rows="6" cols="30" class="textbox" style="width: 520px; height: 100px;"></textarea></div>
			</div>

			<div class="form_row_wrapper">
			<div class="form_row_left"><label for="rating">Rating:</label></div>
			<div class="form_row_right"><select name="rating" id="rating">
			<option value="0">0</option>
			<option value="1">0.5</option>
			<option value="2">1</option>
			<option value="3">1.5</option>
			<option value="4">2</option>
			<option value="5">2.5</option>
			<option value="6">3</option>
			<option value="7">3.5</option>
			<option value="8">4</option>
			<option value="9">4.5</option>
			<option value="10">5</option>
			</select></div>
			</div>
			
			<div class="form_row_wrapper">
			<div class="form_row_left"><label for="date_reviewed">Date:</label></div>
			<div class="form_row_right"><input type="text" name="date_reviewed" id="date_reviewed" value="<?php echo date("d/m/Y"); ?>" /></div>
			</div>
			
			<script type="text/javascript">
			$(function() {
				$("#date_reviewed").datepicker({ dateFormat: 'dd/mm/yy', setDate: '<?php echo date("d/m/Y"); ?>' });
			});
			</script>
			
			<div class="form_row_wrapper">
			<div class="form_row_left">&nbsp;</div>
			<div class="form_row_right"><input type="image" src="images/save_button.png" alt="Save" /></div>
			</div>
			
			</form>
		
		<table width="100%" cellpadding="0" cellspacing="0" class="cms_table">
		<thead><tr><th align="left">User</th><th align="left">Job</th><th align="left">Review</th><th>Rating</th><th>Date</th><th width="50">Delete</th></tr></thead>
		<tbody>
		<?php
		
		$sql = "SELECT reviews.id, reviews.user_id, reviews.job_id, rating, review, date_reviewed, users.firstname, users.surname, jobs.title FROM reviews 
				LEFT JOIN users ON reviews.user_id = users.id 
				LEFT JOIN jobs ON reviews.job_id = jobs.id 
				WHERE reviews.tradesman_id = '".mysql_real_escape_string($_GET['id'])."'";
		$query=mysql_query( $sql ) or die ("Error in query: $sql . " . mysql_error());
		$rows = mysql_num_rows($query);
		
		if($rows > 0){
		
			while($rs=mysql_fetch_assoc($query)){
			
				if($rs['user_id'] == '0' && $rs['job_id'] == '0'){
				echo '<tr><td align="left" valign="top">Not applicable</td><td align="left" valign="top">Not applicable</td><td align="left" valign="top">'.str_replace("\r\n", "<br />", $rs['review']).'</td><td valign="top"><img src="/images/'.$rs['rating'].'-star.gif" alt="" /></td><td valign="top">'.date("d/m/Y", strtotime($rs['date_reviewed'])).'</td><td valign="top"><a onclick="confirm_delete(\'?id='.$_GET['id'].'&amp;delete_feedback='.$rs['id'].'\',\'this feedback\');" title="Delete"><img src="images/delete.png" alt="Delete" /></a></td></tr>';
				}
				
				else{
				echo '<tr><td align="left" valign="top"><a href="edit_user.php?id='.$rs['user_id'].'">'.$rs['firstname'].' '.$rs['surname'].'</a></td><td align="left" valign="top"><a href="edit_job.php?id='.$rs['job_id'].'">'.$rs['title'].'</a></td><td align="left" valign="top">'.str_replace("\r\n", "<br />", $rs['review']).'</td><td valign="top"><img src="/images/'.$rs['rating'].'-star.gif" alt="" /></td><td valign="top">'.date("d/m/Y", strtotime($rs['date_reviewed'])).'</td><td valign="top"><a onclick="confirm_delete(\'?id='.$_GET['id'].'&amp;delete_feedback='.$rs['id'].'\',\'this feedback\');" title="Delete"><img src="images/delete.png" alt="Delete" /></a></td></tr>';
				}
			
			}
			
		}
		
		else{
		
		echo '<tr><td colspan="6">There is currently no feedback for this tradesman.</td></tr>';
		
		}
		
		?>
		
		</tbody></table>
		
		</div>
		
		

	</div>

</div>
	
<?php
	require('includes/footer.php');
?>